<?php
if (!defined('PATH_CORE')) die('access denied');

/**
 * Хранилице настроек проекта
 *
 * @since 30.10.2011
 * @author Akulov Denis <akulov.d.g@gmail.com>
 */
class K_Config {

    private $_arConfig = array();


    public function __construct($strConfigFile) {
        require $strConfigFile;
    }


    public function getConfig ($strConfig) {
        if (!isset($this->_arConfig[$strConfig])) {
            throw new Exception('Empty config: '.$strConfig);
        }

        return $this->_arConfig[$strConfig];
    }


    public function getAttribute ($strConfig, $strAtribute) {
        if (!isset($this->_arConfig[$strConfig][$strAtribute])) {
            throw new Exception('Empty config: '.$strConfig.' attribute: '.$strAtribute);
        }
        return $this->_arConfig[$strConfig][$strAtribute];
    }


    private function setConfig ($strConfig, $arConfig) {
        $this->_arConfig[$strConfig] = $arConfig;
    }
}